<template>
  <div class="operationBtns">
    <div v-for="(item, index) in operationList" :key="index" @click="clickOpera(item.id)">
      <i style="font-size: 16px; margin-bottom: 8px;" :class="item.name"></i>
    </div>
  </div>
</template>
<script>
export default {
  name: "OperationBtns",
  data() {
    return {
      // 操作列表
      operationList: [
        { id: "prevCom", name: "el-icon-arrow-up" },
        { id: "nextCom", name: "el-icon-arrow-down" },
        { id: "copyCom", name: "el-icon-document-copy" },
        { id: "deleteCom", name: "el-icon-delete" }
      ],
    };
  },
  methods: {
    // 点击操作
    clickOpera(id) {
      this.$emit("click-oprta", id);
    },
  }
};
</script>
<style lang="scss" scoped>
.operationBtns {
  position: absolute;
  top: 0;
  right: -40px;
  z-index: 1;
  width: 32px;
  background: #ffffff;
  box-shadow: 0px 0px 4px rgb(0 0 0 / 8%), 0px 2px 6px rgb(0 0 0 / 6%),
    0px 4px 8px 2px rgb(0 0 0 / 4%);
  border-radius: 2px;
  padding-top: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
</style>
